home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 001a / autopl21.zip / AUTOPLAY.SLT < prev   
Text File  |  1990-01-18  |  4KB  |  107 lines

  1. // GlobalWar AutoPlay script for Telix
  2. // Public Domain
  3. // Computer Deli, Inc.
  4. // PO Box 5481
  5. // Everett, WA  98206
  6. // VOICE: (206) 252-4317
  7. // Sorry, because AutoPlay is Public Domain, we cannot supply
  8. // extensive support for AutoPlay.  If you need assistance with
  9. // AutoPlay, please ask your Sysop or local users, do not call
  10. // us.
  11. //
  12. // AutoPlay is for use with TELIX (from Exis Inc.) and GWTERM
  13. // by Joel Bergen.  Computer Deli, Inc., is in no way
  14. // affiliated with either Exis or Joel Bergen.  No official
  15. // support for AutoPlay exists.
  16. //
  17. //                               DISCLAIMER
  18. //                 NO WARANTY ON AUTOPLAY PROGAM OR MANUAL
  19. //
  20. //           THIS SOFTWARE, THE AUTOPLAY PROGRAM AND MANUAL, IS
  21. //           PROVIDED "AS IS" WITHOUT ANY EXPRESSED OR IMPLIED
  22. //           WARRANTIES WHATSOEVER.  BECAUSE OF THE DIVERSITY
  23. //           OF CONDITIONS AND HARDWARE UNDER WHICH THIS
  24. //           SOFTWARE MAY BE USED, NO WARRANTY OF FITNESS FOR A
  25. //           PARTICULAR PURPOSE IS OFFERED.  THE AUTHOR, GEOFF
  26. //           SHEPHERD, OR COMPUTER DELI, INC., CANNOT BE HELD
  27. //           RESPONSIBLE FOR DIRECT, INDIRECT, INCIDENTAL,
  28. //           CONCEQUENTAL, OR OTHER DAMAGES DUE TO YOUR ABILITY
  29. //           OR INABILITY TO USE THIS SOFTWARE, EVEN IF THE
  30. //           AUTHOR OR COMPUTER DELI, INC. HAS BEEN ADVISED OF
  31. //           THE POSSIBILITY OF SUCH DAMAGES.  THE USER IS
  32. //           ADVISED TO TEST THIS SOFTWARE THOROUGHLY BEFORE
  33. //           RELYING ON IT AND MUST ASSUME THE ENTIRE RISK OF
  34. //           USING THIS SOFTWARE.
  35. //
  36. // This script may be mangled, modified, deleted, appended, sold, etc
  37. // as long as you hurt no one but yourself in the process.
  38. //
  39. // o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o o
  40.  
  41. // holds delay value for handshaking
  42. str sDelay[2];
  43.  
  44. // Please leave credit where credit is due, thanks.
  45. str st1[64]="GWTERM AutoPlay v2.1 - Public Domain - Computer Deli, Inc.";
  46.  
  47. main()
  48. {
  49.     str st[64], st2[64];
  50.     int baud, port, dly;
  51.  
  52.         baud=get_baud();
  53.         port=get_port();
  54.         itos(port,st);
  55.         itos(baud,st2);
  56.         strcat(st," ");
  57.         strcat(st,st2);
  58.         clear_scr();
  59.         printsc(st1);
  60.         getdelay();
  61.         prints("");
  62.         dly=stoi(sDelay)-1;
  63.  
  64. loop:
  65.         // ^M^H^M^H is the signal from Global War to start your engines
  66.         // We'll just sit here and wait for it.  Every second, carrier
  67.         // is checked.  If it's lost, then AutoPlay is terminated
  68.  
  69.         while (!waitfor("^M^H^M^H",1))
  70.                 if (!carrier()) {
  71.                         prints("AutoPlay Deactivated.");
  72.                         return;
  73.                 }
  74.         // this is handshaking for GlobalWar.
  75.         // If GW receives a '1' through '8' immediately after the signal
  76.         // is sent to the remote, GW will wait that many seconds before
  77.         // starting into the game to allow the remote system time to
  78.         // sufficient time to load GWTERM
  79.         cputs(sDelay);
  80.         flushbuf();
  81.         run("gwterm",st,0);
  82.         flushbuf();
  83.         goto loop;
  84. }
  85.  
  86. getdelay()
  87. // Reads in delay value from configuration file.
  88. {
  89.         int  file;
  90.         str  name[64];
  91.  
  92.         name = _telix_dir;
  93.  
  94.         strcat(name,"AUTOPLAY.CFG");
  95.  
  96.         file = fopen(name, "r");
  97.         if (!file) {
  98.                 prints("^GGWTERM.CFG not found, using 9 second delay.");
  99.                 sDelay="9";
  100.                 return;
  101.         }
  102.  
  103.         fread(sDelay,1,file);
  104.         fclose(file);
  105. }
  106.  
  107.